//
//  HelloViewController.m
//  Unity-iPhone
//
//  Created by wencun on 4/3/15.
//
//

#import "HelloViewController.h"
#import "CoolUnitySceneviewController.h"

@interface HelloViewController ()

@end

@implementation HelloViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *btnNext = [UIButton buttonWithType:UIButtonTypeSystem];
    [btnNext setTitle:@"这是一个IOS界面，点我进入Unity界面。" forState:UIControlStateNormal];
    btnNext.frame = CGRectMake(40, 200, 300, 44);
    btnNext.layer.borderWidth = 1;
//    btnNext.layer.borderColor = [UIColor grayColor];
    btnNext.layer.cornerRadius = 3;
    btnNext.backgroundColor = [UIColor greenColor];
//    btnNext.center = CGPointMake(self.view.bounds.size.height / 2, 200);
    [self.view addSubview:btnNext];
    self.view.backgroundColor = [UIColor grayColor];
    
    [btnNext addTarget:self action:@selector(gotoUnityScene:) forControlEvents:UIControlEventTouchUpInside];
}

#pragma mark - Private methods
- (void)gotoUnityScene:(id)sender {
    NSLog(@"[HelloVC] Go to unity scene");
    
    CoolUnitySceneViewController *coolUnityVC = [[CoolUnitySceneViewController alloc] initWithNibName:nil bundle:nil];
    [self.navigationController pushViewController:coolUnityVC animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
